package com.leyou.user.client;

import com.leyou.dto.AddressDTO;
import com.leyou.dto.UserDTO;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * 定义feign接口，写入user-service微服务的方法
 * @author jshstart
 * @creat 2020-12-23 14:58
 */
@FeignClient(value = "user-service")
public interface UserClient {
    /**
     * 根据用户名密码查询用户
     * @param username
     * @param password
     * @return
     */
    @GetMapping("/info")
    UserDTO queryUserByNamePassword(@RequestParam("username") String username,
                                                           @RequestParam("password") String password);
    @GetMapping("/address/{id}")
    AddressDTO getMyAddressById(@PathVariable("id") Long id);
}
